//
// Created by Dell on 2021/9/22.
//

#ifndef AI_NODE_H
#define AI_NODE_H

#include<ctime>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>

using namespace std;

class node {
private:
    vector<vector<int>> target = vector<vector<int>>(3, vector<int>(3, 0));// 目标图像
    vector<vector<int> > number = vector<vector<int >>(3, vector<int>(3, 0)); // 图像矩阵
    int g = 0, h = 0;

public:

    int startX = 0, startY = 0; // 初始空位点


    node();

    node(node *tem);

    ~node();

    int countH();

    void setNumber(int x, int y, int tem);

    int getNumber(int x, int y);

    vector<vector<int>> getNumber();

    void swapNumber(int x1, int y1, int x2, int y2);

    void setXAndY(int x, int y);

    void setGAndH(int g, int h);

    int getX();

    int getY();

    bool check();

    friend bool operator<(const node a, const node b) {
        return a.g + a.h > b.g + b.h;
    }
};


#endif //AI_NODE_H
